home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sys / param.h < prev    next >
C/C++ Source or Header  |  1989-07-18  |  3KB  |  94 lines

  1. /*
  2.  * param.h --
  3.  *
  4.  *    This file is modelled after the UNIX include file <sys/param.h>,
  5.  *    but it only contains information that is actually used by user
  6.  *    processes running under Sprite (the UNIX file contains mostly
  7.  *    stuff for the kernel's use).  This file started off empty, and
  8.  *    will gradually accumulate definitions as the needs of user
  9.  *    processes become clearer.
  10.  *
  11.  * Copyright 1988 Regents of the University of California
  12.  * Permission to use, copy, modify, and distribute this
  13.  * software and its documentation for any purpose and without
  14.  * fee is hereby granted, provided that the above copyright
  15.  * notice appear in all copies.  The University of California
  16.  * makes no representations about the suitability of this
  17.  * software for any purpose.  It is provided "as is" without
  18.  * express or implied warranty.
  19.  *
  20.  * $Header: /sprite/src/lib/include/sys/RCS/param.h,v 1.13 89/07/14 09:15:24 rab Exp $ SPRITE (Berkeley)
  21.  */
  22.  
  23. #ifndef _PARAM
  24. #define _PARAM
  25.  
  26. #include <sys/types.h>
  27. #include <signal.h>
  28. #include <machparam.h>
  29.  
  30. /*
  31.  * MAXPATHLEN defines the longest permissable path length
  32.  * after expanding symbolic links.
  33.  */
  34. #define MAXPATHLEN      1024
  35.  
  36. /*
  37.  * MAXBSIZE defines the largest block size stored in the file system.
  38.  */
  39. #define MAXBSIZE    4096
  40.  
  41. /*
  42.  * The macro below converts from the "st_blocks" field of a "struct stat"
  43.  * to the number of bytes allocated to a file.  The "st_blocks" field
  44.  * is currently measured in (archaic) 512-byte units.
  45.  */
  46. #define dbtob(blocks) ((unsigned) (blocks) << 9)
  47.  
  48. /*
  49.  * MAXHOSTNAMELEN defines the maximum length of a host name in the
  50.  * network.
  51.  */
  52. #define MAXHOSTNAMELEN 64
  53.  
  54. /*
  55.  * Maximum number of characters in the argument list for exec.  Is this
  56.  * really a limit in Sprite, or is it here just for backward compatibility?
  57.  */
  58. #define NCARGS 10240
  59.  
  60. /*
  61.  * Maximum number of open files per process.  This is not really a limit
  62.  * for Sprite;  it's merely there for old UNIX programs that expect it.
  63.  */
  64. #define NOFILE 64
  65.  
  66. /*
  67.  * The maximum number of groups that a process can be in at once
  68.  * (the most stuff ever returned by getgroups).  Note:  this needs
  69.  * to be coordinated with FS_NUM_GROUPS, which it isn't right now.
  70.  */
  71. #define NGROUPS 16
  72.  
  73. /*
  74.  * Macros for fast min/max.
  75.  */
  76. #define MIN(a,b) (((a)<(b))?(a):(b))
  77. #define MAX(a,b) (((a)>(b))?(a):(b))
  78.  
  79. /*
  80.  * Round up an object of size x to one that's an integral multiple
  81.  * of size y.
  82.  */
  83.  
  84. #define roundup(x, y)    ((((x) + ((y) -1))/(y))*(y))
  85.  
  86. /*
  87.  * Miscellanous.
  88.  */
  89. #ifndef NULL
  90. #define NULL    0
  91. #endif /* NULL */
  92.  
  93. #endif /* _PARAM */
  94.